using Tools.Domain.Specifications.Constraints;
using Tools.Domain.Specifications.Common.Reflection;
using Webshop20.Domain.Customers.Core;

namespace Webshop20.Domain.Customers.Core
{
    public class AdressConstraintSet : ConstraintSetBase<Adress>
    {
        public AdressConstraintSet(IConstraintContext constraintContext)
            : base(constraintContext)
        {
            AddInvariant(
                new StringFieldIsNotNullOrEmpty<Adress>(x => x.Street, "NO_STREET") &
                new StringFieldIsNotNullOrEmpty<Adress>(x => x.City, "NO_CITY") &
                new StringFieldIsNotNullOrEmpty<Adress>(x => x.PostalCode, "NO_POSTAL_CODE")
                );
        }

    }
}